﻿@using Volo.Abp.AspNetCore.Mvc.AntiForgery
@using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components
@using Volo.Abp.AspNetCore.Mvc.UI.Theming
@using Volo.Abp.AspNetCore.Mvc.UI.Widgets.Components.WidgetScripts
@using Volo.Abp.Localization
@using EasyAbp.Abp.AspNetCore.Mvc.UI.Theme.LYear.Themes.LYear.Components.Menu
@using EasyAbp.Abp.AspNetCore.Mvc.UI.Theme.LYear.Themes.LYear.Components.TopNavbar
@using EasyAbp.Abp.AspNetCore.Mvc.UI.Theme.LYear.Bundling
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
@inject IBrandingProvider BrandingProvider
@inject IPageLayout PageLayout
@{
    Layout = null;
    AbpAntiForgeryManager.SetCookie();

    var pageTitle = ViewBag.Title == null ? BrandingProvider.AppName : ViewBag.Title; //TODO: Discard to get from Title

    if (PageLayout.Content.Title != null)
    {
        if (!string.IsNullOrWhiteSpace(pageTitle))
        {
            pageTitle = " | " + pageTitle;
        }

        pageTitle = PageLayout.Content.Title + pageTitle;
    }

    var rtl = CultureHelper.IsRtl ? "rtl" : string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    @await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Application)
    <title>@pageTitle</title>

    <abp-style-bundle name="@LYearThemeBundles.Styles.Global"/>
    @await RenderSectionAsync("styles", false)
</head>
<body>
    @await Component.InvokeLayoutHookAsync(LayoutHooks.Body.First, StandardLayouts.Application)
    <div id="app">
        <div>
            <div>
                @(await Component.InvokeAsync<LeftNavbarMenuViewComponent>())
                <!--头部信息-->
                <header class="lyear-layout-header">
                    @(await Component.InvokeAsync<TopNavbarViewComponent>())
                </header>
                <!--End 头部信息-->
                <!--页面主要内容-->
                <main class="lyear-layout-content">
                    <div class="container-fluid">
                        @RenderBody()
                    </div>
                </main>
                <!--End 页面主要内容-->
            </div>
        </div>
    </div>
    <abp-script-bundle name="@LYearThemeBundles.Scripts.Global" />

    <script src="~/Abp/ApplicationConfigurationScript"></script>
    <script src="~/Abp/ServiceProxyScript"></script>
    <script src="~/themes/lyear/assets/js/main.min.js"></script>
    <script src="~/themes/lyear/assets/js/perfectscrollbar.min.js"></script>
    @await Component.InvokeAsync(typeof(WidgetScriptsViewComponent))

    @await RenderSectionAsync("scripts", false)
    @await Component.InvokeLayoutHookAsync(LayoutHooks.Body.Last, StandardLayouts.Application)
</body>
</html>